Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POC: Simplifying un-abstracting projections and setup #70157

Closed

Conversation

sorenlouv
Copy link
Member

Started with a single file where setup is no longer passed (individual params are passed instead).


const params = mergeProjection(projection, {
const params = {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving away from mergeProjection will make the code a lot more clear - especially for reviewers when things are changed/moved around

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason why we have mergeProjection is two-fold:

  • lodash.merge merges arrays in really weird ways
  • if you change a projection, its consumers do not need to update anything (usually).

The downside of spreading only means that you can miss places where the projection is being used. E.g., you'd have to manually inspect all references. Maybe that's a good thing though. Again not a defense - just want to highlight why it's there.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you change a projection, its consumers do not need to update anything (usually).

This makes sense. Could we achieve the same with unit tests to ensure that projections are correctly applied?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that depends on the nature of the change. for additive changes, no. for other changes, yes (arguably already covered by snapshot testing of queries)

},
})
: filter,
filter: [...projection.body.query.bool.filter, ...serviceNameFilter],
Copy link
Member Author

@sorenlouv sorenlouv Jun 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good example of the confusion I get from the projection:

  • we have a higher order function mergeProjection that merges some stuff
  • then we have projection.body.query.bool which is spreaded onto bool (is this needed if we already have mergeProjection?)
  • then we have a specific part of the projection being merged with the full bool projection + some other stuff

What takes precendence? Is ...projection.body.query.bool really needed?

In my rewrite I propose we do away with mergeProjection because it's quite opaque in it's merge behaviour. Instead I suggest we do dead-simple spread concatenations (filter: [...projection.body.query.bool.filter, ...serviceNameFilter]), or even prop assignments (index: projection.index).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mergeProjection = mergePlainObject, e.g. it doesn't merge arrays. If you merge arrays, you can't remove items. Arguably the same applies for merging objects, but that feels more natural. If I speak for myself, in some cases I use explicit spreading so that the shape of the request (ie the result of mergeProjection) is more clear. (Not a argument for or against projections, just an explanation).

@kibanamachine
Copy link
Contributor

💔 Build Failed

Failed CI Steps


Test Failures

Kibana Pipeline / kibana-xpack-agent / X-Pack APM API integration tests (basic).x-pack/test/apm_api_integration/basic/tests/feature_controls·ts.APM specs (basic) apm feature controls APIs can be accessed by global_all user

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has failed 1 times on tracked branches: https://dryrun

[00:00:00]       │
[00:00:00]         └-: APM specs (basic)
[00:00:00]           └-> "before all" hook
[00:00:00]           └-: apm feature controls
[00:00:00]             └-> "before all" hook
[00:00:00]             └-> "before all" hook
[00:00:00]               │ info Creating agent configuration
[00:00:00]               │ proc [kibana]   log   [13:13:48.576] [error][apm][plugins] Could not get dynamic index pattern because indices "apm-*,apm-*,apm-*" don't exist
[00:00:00]               │ proc [kibana]   log   [13:13:48.617] [info][apm][plugins] Creating config test-service/undefined
[00:00:00]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-16-tests-xl-1593344847453102376] [.apm-agent-configuration/Gc42Kv-ORGqRPBnzMqik9A] update_mapping [_doc]
[00:00:01]               │ info Agent configuration created
[00:00:01]             └-> APIs can't be accessed by logstash_read user
[00:00:01]               └-> "before each" hook: global before each
[00:00:01]               │ debg creating role logstash_read
[00:00:01]               │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-ubuntu-16-tests-xl-1593344847453102376] added role [logstash_read]
[00:00:01]               │ debg creating user logstash_read
[00:00:01]               │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-ubuntu-16-tests-xl-1593344847453102376] added user [logstash_read]
[00:00:01]               │ debg created user logstash_read
[00:00:01]               │ info Requesting: /api/apm/services/foo/errors?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&uiFilters=%7B%7D&_debug=true. Expecting: forbidden
[00:00:01]               │ proc [kibana]   log   [13:13:49.139] [warning][api-authorization][plugins][security] User not authorized for "/api/apm/services/foo/errors?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&uiFilters=%7B%7D&_debug=true": responding with 404
[00:00:01]               │ info Responded: /api/apm/services/foo/errors?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&uiFilters=%7B%7D&_debug=true
[00:00:01]               │ info Requesting: /api/apm/services/foo/errors/bar?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&uiFilters=%7B%7D. Expecting: forbidden
[00:00:01]               │ proc [kibana]   log   [13:13:49.227] [warning][api-authorization][plugins][security] User not authorized for "/api/apm/services/foo/errors/bar?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&uiFilters=%7B%7D": responding with 404
[00:00:01]               │ info Responded: /api/apm/services/foo/errors/bar?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&uiFilters=%7B%7D
[00:00:01]               │ info Requesting: /api/apm/services/foo/errors/distribution?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&groupId=bar&uiFilters=%7B%7D. Expecting: forbidden
[00:00:01]               │ proc [kibana]   log   [13:13:49.321] [warning][api-authorization][plugins][security] User not authorized for "/api/apm/services/foo/errors/distribution?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&groupId=bar&uiFilters=%7B%7D": responding with 404
[00:00:01]               │ info Responded: /api/apm/services/foo/errors/distribution?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&groupId=bar&uiFilters=%7B%7D
[00:00:01]               │ info Requesting: /api/apm/services/foo/errors/distribution?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&uiFilters=%7B%7D. Expecting: forbidden
[00:00:01]               │ proc [kibana]   log   [13:13:49.390] [warning][api-authorization][plugins][security] User not authorized for "/api/apm/services/foo/errors/distribution?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&uiFilters=%7B%7D": responding with 404
[00:00:01]               │ info Responded: /api/apm/services/foo/errors/distribution?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&uiFilters=%7B%7D
[00:00:01]               │ info Requesting: /api/apm/services/foo/metrics/charts?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&agentName=cool-agent&uiFilters=%7B%7D. Expecting: forbidden
[00:00:01]               │ proc [kibana]   log   [13:13:49.456] [warning][api-authorization][plugins][security] User not authorized for "/api/apm/services/foo/metrics/charts?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&agentName=cool-agent&uiFilters=%7B%7D": responding with 404
[00:00:01]               │ info Responded: /api/apm/services/foo/metrics/charts?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&agentName=cool-agent&uiFilters=%7B%7D
[00:00:01]               │ info Requesting: /api/apm/services?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&uiFilters=%7B%7D. Expecting: forbidden
[00:00:01]               │ proc [kibana]   log   [13:13:49.527] [warning][api-authorization][plugins][security] User not authorized for "/api/apm/services?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&uiFilters=%7B%7D": responding with 404
[00:00:01]               │ info Responded: /api/apm/services?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&uiFilters=%7B%7D
[00:00:01]               │ info Requesting: /api/apm/services/foo/agent_name?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z. Expecting: forbidden
[00:00:01]               │ proc [kibana]   log   [13:13:49.591] [warning][api-authorization][plugins][security] User not authorized for "/api/apm/services/foo/agent_name?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z": responding with 404
[00:00:01]               │ info Responded: /api/apm/services/foo/agent_name?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z
[00:00:01]               │ info Requesting: /api/apm/services/foo/transaction_types?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z. Expecting: forbidden
[00:00:01]               │ proc [kibana]   log   [13:13:49.662] [warning][api-authorization][plugins][security] User not authorized for "/api/apm/services/foo/transaction_types?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z": responding with 404
[00:00:02]               │ info Responded: /api/apm/services/foo/transaction_types?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z
[00:00:02]               │ info Requesting: /api/apm/traces?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&uiFilters=%7B%7D. Expecting: forbidden
[00:00:02]               │ proc [kibana]   log   [13:13:49.730] [warning][api-authorization][plugins][security] User not authorized for "/api/apm/traces?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&uiFilters=%7B%7D": responding with 404
[00:00:02]               │ info Responded: /api/apm/traces?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&uiFilters=%7B%7D
[00:00:02]               │ info Requesting: /api/apm/traces/foo?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z. Expecting: forbidden
[00:00:02]               │ proc [kibana]   log   [13:13:49.796] [warning][api-authorization][plugins][security] User not authorized for "/api/apm/traces/foo?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z": responding with 404
[00:00:02]               │ info Responded: /api/apm/traces/foo?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z
[00:00:02]               │ info Requesting: /api/apm/services/foo/transaction_groups?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&transactionType=bar&uiFilters=%7B%7D. Expecting: forbidden
[00:00:02]               │ proc [kibana]   log   [13:13:49.859] [warning][api-authorization][plugins][security] User not authorized for "/api/apm/services/foo/transaction_groups?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&transactionType=bar&uiFilters=%7B%7D": responding with 404
[00:00:02]               │ info Responded: /api/apm/services/foo/transaction_groups?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&transactionType=bar&uiFilters=%7B%7D
[00:00:02]               │ info Requesting: /api/apm/services/foo/transaction_groups/charts?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&transactionType=bar&uiFilters=%7B%7D. Expecting: forbidden
[00:00:02]               │ proc [kibana]   log   [13:13:49.933] [warning][api-authorization][plugins][security] User not authorized for "/api/apm/services/foo/transaction_groups/charts?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&transactionType=bar&uiFilters=%7B%7D": responding with 404
[00:00:02]               │ info Responded: /api/apm/services/foo/transaction_groups/charts?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&transactionType=bar&uiFilters=%7B%7D
[00:00:02]               │ info Requesting: /api/apm/services/foo/transaction_groups/charts?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&uiFilters=%7B%7D. Expecting: forbidden
[00:00:02]               │ proc [kibana]   log   [13:13:50.005] [warning][api-authorization][plugins][security] User not authorized for "/api/apm/services/foo/transaction_groups/charts?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&uiFilters=%7B%7D": responding with 404
[00:00:02]               │ info Responded: /api/apm/services/foo/transaction_groups/charts?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&uiFilters=%7B%7D
[00:00:02]               │ info Requesting: /api/apm/services/foo/transaction_groups/charts?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&transactionType=bar&transactionName=baz&uiFilters=%7B%7D. Expecting: forbidden
[00:00:02]               │ proc [kibana]   log   [13:13:50.100] [warning][api-authorization][plugins][security] User not authorized for "/api/apm/services/foo/transaction_groups/charts?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&transactionType=bar&transactionName=baz&uiFilters=%7B%7D": responding with 404
[00:00:02]               │ info Responded: /api/apm/services/foo/transaction_groups/charts?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&transactionType=bar&transactionName=baz&uiFilters=%7B%7D
[00:00:02]               │ info Requesting: /api/apm/services/foo/transaction_groups/distribution?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&transactionType=bar&transactionName=baz&uiFilters=%7B%7D. Expecting: forbidden
[00:00:02]               │ proc [kibana]   log   [13:13:50.184] [warning][api-authorization][plugins][security] User not authorized for "/api/apm/services/foo/transaction_groups/distribution?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&transactionType=bar&transactionName=baz&uiFilters=%7B%7D": responding with 404
[00:00:02]               │ info Responded: /api/apm/services/foo/transaction_groups/distribution?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&transactionType=bar&transactionName=baz&uiFilters=%7B%7D
[00:00:02]               │ info Requesting: /api/apm/settings/agent-configuration/search. Expecting: forbidden
[00:00:02]               │ proc [kibana]   log   [13:13:50.253] [warning][api-authorization][plugins][security] User not authorized for "/api/apm/settings/agent-configuration/search": responding with 404
[00:00:02]               │ info Responded: /api/apm/settings/agent-configuration/search
[00:00:02]               │ info Requesting: /api/apm/settings/custom_links. Expecting: forbidden
[00:00:02]               │ proc [kibana]   log   [13:13:50.325] [warning][api-authorization][plugins][security] User not authorized for "/api/apm/settings/custom_links": responding with 404
[00:00:02]               │ info Responded: /api/apm/settings/custom_links
[00:00:02]               │ info Requesting: /api/apm/settings/custom_links/transaction. Expecting: forbidden
[00:00:02]               │ proc [kibana]   log   [13:13:50.397] [warning][api-authorization][plugins][security] User not authorized for "/api/apm/settings/custom_links/transaction": responding with 404
[00:00:02]               │ info Responded: /api/apm/settings/custom_links/transaction
[00:00:02]               │ debg deleting role logstash_read
[00:00:02]               │ debg deleting user logstash_read
[00:00:02]               │ debg deleted user logstash_read
[00:00:02]               └- ✓ pass  (1.8s) "APM specs (basic) apm feature controls APIs can't be accessed by logstash_read user"
[00:00:02]             └-> APIs can be accessed by global_all user
[00:00:02]               └-> "before each" hook: global before each
[00:00:02]               │ debg creating role global_all
[00:00:02]               │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-ubuntu-16-tests-xl-1593344847453102376] added role [global_all]
[00:00:02]               │ debg creating user global_all
[00:00:03]               │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-ubuntu-16-tests-xl-1593344847453102376] added user [global_all]
[00:00:03]               │ debg created user global_all
[00:00:03]               │ info Requesting: /api/apm/services/foo/errors?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&uiFilters=%7B%7D&_debug=true. Expecting: response
[00:00:03]               │ proc [kibana] === Debug: GET /api/apm/services/foo/errors (5ms) ===
[00:00:03]               │ proc [kibana] GET apm-*/_search
[00:00:03]               │ proc [kibana] {
[00:00:03]               │ proc [kibana]   "query": {
[00:00:03]               │ proc [kibana]     "bool": {
[00:00:03]               │ proc [kibana]       "filter": [
[00:00:03]               │ proc [kibana]         {
[00:00:03]               │ proc [kibana]           "term": {
[00:00:03]               │ proc [kibana]             "service.name": "foo"
[00:00:03]               │ proc [kibana]           }
[00:00:03]               │ proc [kibana]         },
[00:00:03]               │ proc [kibana]         {
[00:00:03]               │ proc [kibana]           "term": {
[00:00:03]               │ proc [kibana]             "processor.event": "error"
[00:00:03]               │ proc [kibana]           }
[00:00:03]               │ proc [kibana]         },
[00:00:03]               │ proc [kibana]         {
[00:00:03]               │ proc [kibana]           "range": {
[00:00:03]               │ proc [kibana]             "@timestamp": {
[00:00:03]               │ proc [kibana]               "gte": 1593350017664,
[00:00:03]               │ proc [kibana]               "lte": 1593350027664,
[00:00:03]               │ proc [kibana]               "format": "epoch_millis"
[00:00:03]               │ proc [kibana]             }
[00:00:03]               │ proc [kibana]           }
[00:00:03]               │ proc [kibana]         },
[00:00:03]               │ proc [kibana]         {
[00:00:03]               │ proc [kibana]           "range": {
[00:00:03]               │ proc [kibana]             "observer.version_major": {
[00:00:03]               │ proc [kibana]               "gte": 7
[00:00:03]               │ proc [kibana]             }
[00:00:03]               │ proc [kibana]           }
[00:00:03]               │ proc [kibana]         }
[00:00:03]               │ proc [kibana]       ]
[00:00:03]               │ proc [kibana]     }
[00:00:03]               │ proc [kibana]   },
[00:00:03]               │ proc [kibana]   "aggs": {
[00:00:03]               │ proc [kibana]     "error_groups": {
[00:00:03]               │ proc [kibana]       "terms": {
[00:00:03]               │ proc [kibana]         "field": "error.grouping_key",
[00:00:03]               │ proc [kibana]         "size": 500,
[00:00:03]               │ proc [kibana]         "order": {
[00:00:03]               │ proc [kibana]           "_count": "desc"
[00:00:03]               │ proc [kibana]         }
[00:00:03]               │ proc [kibana]       },
[00:00:03]               │ proc [kibana]       "aggs": {
[00:00:03]               │ proc [kibana]         "sample": {
[00:00:03]               │ proc [kibana]           "top_hits": {
[00:00:03]               │ proc [kibana]             "_source": [
[00:00:03]               │ proc [kibana]               "error.log.message",
[00:00:03]               │ proc [kibana]               "error.exception.message",
[00:00:03]               │ proc [kibana]               "error.exception.handled",
[00:00:03]               │ proc [kibana]               "error.exception.type",
[00:00:03]               │ proc [kibana]               "error.culprit",
[00:00:03]               │ proc [kibana]               "error.grouping_key",
[00:00:03]               │ proc [kibana]               "@timestamp"
[00:00:03]               │ proc [kibana]             ],
[00:00:03]               │ proc [kibana]             "sort": [
[00:00:03]               │ proc [kibana]               {
[00:00:03]               │ proc [kibana]                 "@timestamp": "desc"
[00:00:03]               │ proc [kibana]               }
[00:00:03]               │ proc [kibana]             ],
[00:00:03]               │ proc [kibana]             "size": 1
[00:00:03]               │ proc [kibana]           }
[00:00:03]               │ proc [kibana]         }
[00:00:03]               │ proc [kibana]       }
[00:00:03]               │ proc [kibana]     }
[00:00:03]               │ proc [kibana]   },
[00:00:03]               │ proc [kibana]   "size": 0
[00:00:03]               │ proc [kibana] }
[00:00:03]               │ proc [kibana] 
[00:00:03]               │ proc [kibana] 
[00:00:03]               │ info Responded: /api/apm/services/foo/errors?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&uiFilters=%7B%7D&_debug=true
[00:00:03]               │ info Requesting: /api/apm/services/foo/errors/bar?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&uiFilters=%7B%7D. Expecting: response
[00:00:03]               │ info Responded: /api/apm/services/foo/errors/bar?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&uiFilters=%7B%7D
[00:00:03]               │ info Requesting: /api/apm/services/foo/errors/distribution?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&groupId=bar&uiFilters=%7B%7D. Expecting: response
[00:00:04]               │ info Responded: /api/apm/services/foo/errors/distribution?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&groupId=bar&uiFilters=%7B%7D
[00:00:04]               │ info Requesting: /api/apm/services/foo/errors/distribution?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&uiFilters=%7B%7D. Expecting: response
[00:00:04]               │ info Responded: /api/apm/services/foo/errors/distribution?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&uiFilters=%7B%7D
[00:00:04]               │ info Requesting: /api/apm/services/foo/metrics/charts?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&agentName=cool-agent&uiFilters=%7B%7D. Expecting: response
[00:00:04]               │ info Responded: /api/apm/services/foo/metrics/charts?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&agentName=cool-agent&uiFilters=%7B%7D
[00:00:04]               │ info Requesting: /api/apm/services?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&uiFilters=%7B%7D. Expecting: response
[00:00:04]               │ proc [kibana]   log   [13:13:51.897] [error][http] { Error: [parsing_exception] Unknown key for a START_ARRAY in [index]., with { line=1 & col=10 }
[00:00:04]               │ proc [kibana]     at respond (/dev/shm/workspace/install/kibana-2/node_modules/elasticsearch/src/lib/transport.js:349:15)
[00:00:04]               │ proc [kibana]     at checkRespForFailure (/dev/shm/workspace/install/kibana-2/node_modules/elasticsearch/src/lib/transport.js:306:7)
[00:00:04]               │ proc [kibana]     at HttpConnector.<anonymous> (/dev/shm/workspace/install/kibana-2/node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
[00:00:04]               │ proc [kibana]     at IncomingMessage.wrapper (/dev/shm/workspace/install/kibana-2/node_modules/elasticsearch/node_modules/lodash/lodash.js:4929:19)
[00:00:04]               │ proc [kibana]     at IncomingMessage.emit (events.js:203:15)
[00:00:04]               │ proc [kibana]     at endReadableNT (_stream_readable.js:1145:12)
[00:00:04]               │ proc [kibana]     at process._tickCallback (internal/process/next_tick.js:63:19)
[00:00:04]               │ proc [kibana]   status: 400,
[00:00:04]               │ proc [kibana]   displayName: 'BadRequest',
[00:00:04]               │ proc [kibana]   message:
[00:00:04]               │ proc [kibana]    '[parsing_exception] Unknown key for a START_ARRAY in [index]., with { line=1 & col=10 }',
[00:00:04]               │ proc [kibana]   path: '/_search',
[00:00:04]               │ proc [kibana]   query: { ignore_throttled: true },
[00:00:04]               │ proc [kibana]   body:
[00:00:04]               │ proc [kibana]    { error:
[00:00:04]               │ proc [kibana]       { root_cause: [Array],
[00:00:04]               │ proc [kibana]         type: 'parsing_exception',
[00:00:04]               │ proc [kibana]         reason: 'Unknown key for a START_ARRAY in [index].',
[00:00:04]               │ proc [kibana]         line: 1,
[00:00:04]               │ proc [kibana]         col: 10 },
[00:00:04]               │ proc [kibana]      status: 400 },
[00:00:04]               │ proc [kibana]   statusCode: 400,
[00:00:04]               │ proc [kibana]   response:
[00:00:04]               │ proc [kibana]    '{"error":{"root_cause":[{"type":"parsing_exception","reason":"Unknown key for a START_ARRAY in [index].","line":1,"col":10}],"type":"parsing_exception","reason":"Unknown key for a START_ARRAY in [index].","line":1,"col":10},"status":400}',
[00:00:04]               │ proc [kibana]   toString: [Function],
[00:00:04]               │ proc [kibana]   toJSON: [Function] }
[00:00:04]               │ info Responded: /api/apm/services?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&uiFilters=%7B%7D
[00:00:04]               │ debg deleting role global_all
[00:00:04]               │ proc [kibana]  error  [13:13:51.832]  Error: Internal Server Error
[00:00:04]               │ proc [kibana]     at HapiResponseAdapter.toInternalError (/dev/shm/workspace/install/kibana-2/src/core/server/http/router/response_adapter.js:69:19)
[00:00:04]               │ proc [kibana]     at Router.handle (/dev/shm/workspace/install/kibana-2/src/core/server/http/router/router.js:163:34)
[00:00:04]               │ proc [kibana]     at process._tickCallback (internal/process/next_tick.js:68:7)
[00:00:04]               │ debg deleting user global_all
[00:00:04]               │ debg deleted user global_all
[00:00:04]               └- ✖ fail: "APM specs (basic) apm feature controls APIs can be accessed by global_all user"
[00:00:04]               │

Stack Trace

Error: Endpoint: GET /api/apm/services?start=2020-06-28T13%3A13%3A37.664Z&end=2020-06-28T13%3A13%3A47.664Z&uiFilters=%7B%7D
          Status code: 500
          Response: An internal server error occurred.

          expected 500 to equal 200
    at executeRequests (test/apm_api_integration/basic/tests/feature_controls.ts:249:15)

Kibana Pipeline / kibana-xpack-agent / X-Pack APM API integration tests (basic).x-pack/test/apm_api_integration/basic/tests/feature_controls·ts.APM specs (basic) apm feature controls APIs can be accessed by global_all user

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has not failed recently on tracked branches

[00:00:00]       │
[00:00:00]         └-: APM specs (basic)
[00:00:00]           └-> "before all" hook
[00:00:01]           └-: apm feature controls
[00:00:01]             └-> "before all" hook
[00:00:01]             └-> "before all" hook
[00:00:01]               │ info Creating agent configuration
[00:00:01]               │ proc [kibana]   log   [12:48:39.283] [error][apm][plugins] Could not get dynamic index pattern because indices "apm-*,apm-*,apm-*" don't exist
[00:00:01]               │ proc [kibana]   log   [12:48:39.337] [info][apm][plugins] Creating config test-service/undefined
[00:00:01]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-ubuntu-16-tests-xl-1593344847453102376] [.apm-agent-configuration/CUdYhd1uQDK6E9ClNi7xTw] update_mapping [_doc]
[00:00:01]               │ info Agent configuration created
[00:00:01]             └-> APIs can't be accessed by logstash_read user
[00:00:01]               └-> "before each" hook: global before each
[00:00:01]               │ debg creating role logstash_read
[00:00:01]               │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-ubuntu-16-tests-xl-1593344847453102376] added role [logstash_read]
[00:00:01]               │ debg creating user logstash_read
[00:00:01]               │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-ubuntu-16-tests-xl-1593344847453102376] added user [logstash_read]
[00:00:01]               │ debg created user logstash_read
[00:00:01]               │ info Requesting: /api/apm/services/foo/errors?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&uiFilters=%7B%7D&_debug=true. Expecting: forbidden
[00:00:01]               │ proc [kibana]   log   [12:48:39.837] [warning][api-authorization][plugins][security] User not authorized for "/api/apm/services/foo/errors?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&uiFilters=%7B%7D&_debug=true": responding with 404
[00:00:01]               │ info Responded: /api/apm/services/foo/errors?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&uiFilters=%7B%7D&_debug=true
[00:00:01]               │ info Requesting: /api/apm/services/foo/errors/bar?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&uiFilters=%7B%7D. Expecting: forbidden
[00:00:01]               │ proc [kibana]   log   [12:48:39.919] [warning][api-authorization][plugins][security] User not authorized for "/api/apm/services/foo/errors/bar?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&uiFilters=%7B%7D": responding with 404
[00:00:01]               │ info Responded: /api/apm/services/foo/errors/bar?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&uiFilters=%7B%7D
[00:00:01]               │ info Requesting: /api/apm/services/foo/errors/distribution?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&groupId=bar&uiFilters=%7B%7D. Expecting: forbidden
[00:00:01]               │ proc [kibana]   log   [12:48:40.012] [warning][api-authorization][plugins][security] User not authorized for "/api/apm/services/foo/errors/distribution?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&groupId=bar&uiFilters=%7B%7D": responding with 404
[00:00:01]               │ info Responded: /api/apm/services/foo/errors/distribution?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&groupId=bar&uiFilters=%7B%7D
[00:00:01]               │ info Requesting: /api/apm/services/foo/errors/distribution?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&uiFilters=%7B%7D. Expecting: forbidden
[00:00:01]               │ proc [kibana]   log   [12:48:40.107] [warning][api-authorization][plugins][security] User not authorized for "/api/apm/services/foo/errors/distribution?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&uiFilters=%7B%7D": responding with 404
[00:00:02]               │ info Responded: /api/apm/services/foo/errors/distribution?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&uiFilters=%7B%7D
[00:00:02]               │ info Requesting: /api/apm/services/foo/metrics/charts?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&agentName=cool-agent&uiFilters=%7B%7D. Expecting: forbidden
[00:00:02]               │ proc [kibana]   log   [12:48:40.187] [warning][api-authorization][plugins][security] User not authorized for "/api/apm/services/foo/metrics/charts?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&agentName=cool-agent&uiFilters=%7B%7D": responding with 404
[00:00:02]               │ info Responded: /api/apm/services/foo/metrics/charts?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&agentName=cool-agent&uiFilters=%7B%7D
[00:00:02]               │ info Requesting: /api/apm/services?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&uiFilters=%7B%7D. Expecting: forbidden
[00:00:02]               │ proc [kibana]   log   [12:48:40.264] [warning][api-authorization][plugins][security] User not authorized for "/api/apm/services?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&uiFilters=%7B%7D": responding with 404
[00:00:02]               │ info Responded: /api/apm/services?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&uiFilters=%7B%7D
[00:00:02]               │ info Requesting: /api/apm/services/foo/agent_name?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z. Expecting: forbidden
[00:00:02]               │ proc [kibana]   log   [12:48:40.340] [warning][api-authorization][plugins][security] User not authorized for "/api/apm/services/foo/agent_name?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z": responding with 404
[00:00:02]               │ info Responded: /api/apm/services/foo/agent_name?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z
[00:00:02]               │ info Requesting: /api/apm/services/foo/transaction_types?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z. Expecting: forbidden
[00:00:02]               │ proc [kibana]   log   [12:48:40.417] [warning][api-authorization][plugins][security] User not authorized for "/api/apm/services/foo/transaction_types?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z": responding with 404
[00:00:02]               │ info Responded: /api/apm/services/foo/transaction_types?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z
[00:00:02]               │ info Requesting: /api/apm/traces?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&uiFilters=%7B%7D. Expecting: forbidden
[00:00:02]               │ proc [kibana]   log   [12:48:40.490] [warning][api-authorization][plugins][security] User not authorized for "/api/apm/traces?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&uiFilters=%7B%7D": responding with 404
[00:00:02]               │ info Responded: /api/apm/traces?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&uiFilters=%7B%7D
[00:00:02]               │ info Requesting: /api/apm/traces/foo?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z. Expecting: forbidden
[00:00:02]               │ proc [kibana]   log   [12:48:40.576] [warning][api-authorization][plugins][security] User not authorized for "/api/apm/traces/foo?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z": responding with 404
[00:00:02]               │ info Responded: /api/apm/traces/foo?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z
[00:00:02]               │ info Requesting: /api/apm/services/foo/transaction_groups?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&transactionType=bar&uiFilters=%7B%7D. Expecting: forbidden
[00:00:02]               │ proc [kibana]   log   [12:48:40.659] [warning][api-authorization][plugins][security] User not authorized for "/api/apm/services/foo/transaction_groups?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&transactionType=bar&uiFilters=%7B%7D": responding with 404
[00:00:02]               │ info Responded: /api/apm/services/foo/transaction_groups?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&transactionType=bar&uiFilters=%7B%7D
[00:00:02]               │ info Requesting: /api/apm/services/foo/transaction_groups/charts?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&transactionType=bar&uiFilters=%7B%7D. Expecting: forbidden
[00:00:02]               │ proc [kibana]   log   [12:48:40.740] [warning][api-authorization][plugins][security] User not authorized for "/api/apm/services/foo/transaction_groups/charts?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&transactionType=bar&uiFilters=%7B%7D": responding with 404
[00:00:02]               │ info Responded: /api/apm/services/foo/transaction_groups/charts?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&transactionType=bar&uiFilters=%7B%7D
[00:00:02]               │ info Requesting: /api/apm/services/foo/transaction_groups/charts?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&uiFilters=%7B%7D. Expecting: forbidden
[00:00:02]               │ proc [kibana]   log   [12:48:40.838] [warning][api-authorization][plugins][security] User not authorized for "/api/apm/services/foo/transaction_groups/charts?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&uiFilters=%7B%7D": responding with 404
[00:00:02]               │ info Responded: /api/apm/services/foo/transaction_groups/charts?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&uiFilters=%7B%7D
[00:00:02]               │ info Requesting: /api/apm/services/foo/transaction_groups/charts?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&transactionType=bar&transactionName=baz&uiFilters=%7B%7D. Expecting: forbidden
[00:00:02]               │ proc [kibana]   log   [12:48:40.911] [warning][api-authorization][plugins][security] User not authorized for "/api/apm/services/foo/transaction_groups/charts?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&transactionType=bar&transactionName=baz&uiFilters=%7B%7D": responding with 404
[00:00:02]               │ info Responded: /api/apm/services/foo/transaction_groups/charts?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&transactionType=bar&transactionName=baz&uiFilters=%7B%7D
[00:00:02]               │ info Requesting: /api/apm/services/foo/transaction_groups/distribution?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&transactionType=bar&transactionName=baz&uiFilters=%7B%7D. Expecting: forbidden
[00:00:02]               │ proc [kibana]   log   [12:48:40.979] [warning][api-authorization][plugins][security] User not authorized for "/api/apm/services/foo/transaction_groups/distribution?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&transactionType=bar&transactionName=baz&uiFilters=%7B%7D": responding with 404
[00:00:02]               │ info Responded: /api/apm/services/foo/transaction_groups/distribution?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&transactionType=bar&transactionName=baz&uiFilters=%7B%7D
[00:00:02]               │ info Requesting: /api/apm/settings/agent-configuration/search. Expecting: forbidden
[00:00:02]               │ proc [kibana]   log   [12:48:41.057] [warning][api-authorization][plugins][security] User not authorized for "/api/apm/settings/agent-configuration/search": responding with 404
[00:00:02]               │ info Responded: /api/apm/settings/agent-configuration/search
[00:00:03]               │ info Requesting: /api/apm/settings/custom_links. Expecting: forbidden
[00:00:03]               │ proc [kibana]   log   [12:48:41.137] [warning][api-authorization][plugins][security] User not authorized for "/api/apm/settings/custom_links": responding with 404
[00:00:03]               │ info Responded: /api/apm/settings/custom_links
[00:00:03]               │ info Requesting: /api/apm/settings/custom_links/transaction. Expecting: forbidden
[00:00:03]               │ proc [kibana]   log   [12:48:41.236] [warning][api-authorization][plugins][security] User not authorized for "/api/apm/settings/custom_links/transaction": responding with 404
[00:00:03]               │ info Responded: /api/apm/settings/custom_links/transaction
[00:00:03]               │ debg deleting role logstash_read
[00:00:03]               │ debg deleting user logstash_read
[00:00:03]               │ debg deleted user logstash_read
[00:00:03]               └- ✓ pass  (2.0s) "APM specs (basic) apm feature controls APIs can't be accessed by logstash_read user"
[00:00:03]             └-> APIs can be accessed by global_all user
[00:00:03]               └-> "before each" hook: global before each
[00:00:03]               │ debg creating role global_all
[00:00:03]               │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-ubuntu-16-tests-xl-1593344847453102376] added role [global_all]
[00:00:03]               │ debg creating user global_all
[00:00:03]               │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-ubuntu-16-tests-xl-1593344847453102376] added user [global_all]
[00:00:03]               │ debg created user global_all
[00:00:03]               │ info Requesting: /api/apm/services/foo/errors?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&uiFilters=%7B%7D&_debug=true. Expecting: response
[00:00:04]               │ proc [kibana] === Debug: GET /api/apm/services/foo/errors (5ms) ===
[00:00:04]               │ proc [kibana] GET apm-*/_search
[00:00:04]               │ proc [kibana] {
[00:00:04]               │ proc [kibana]   "query": {
[00:00:04]               │ proc [kibana]     "bool": {
[00:00:04]               │ proc [kibana]       "filter": [
[00:00:04]               │ proc [kibana]         {
[00:00:04]               │ proc [kibana]           "term": {
[00:00:04]               │ proc [kibana]             "service.name": "foo"
[00:00:04]               │ proc [kibana]           }
[00:00:04]               │ proc [kibana]         },
[00:00:04]               │ proc [kibana]         {
[00:00:04]               │ proc [kibana]           "term": {
[00:00:04]               │ proc [kibana]             "processor.event": "error"
[00:00:04]               │ proc [kibana]           }
[00:00:04]               │ proc [kibana]         },
[00:00:04]               │ proc [kibana]         {
[00:00:04]               │ proc [kibana]           "range": {
[00:00:04]               │ proc [kibana]             "@timestamp": {
[00:00:04]               │ proc [kibana]               "gte": 1593348508110,
[00:00:04]               │ proc [kibana]               "lte": 1593348518110,
[00:00:04]               │ proc [kibana]               "format": "epoch_millis"
[00:00:04]               │ proc [kibana]             }
[00:00:04]               │ proc [kibana]           }
[00:00:04]               │ proc [kibana]         },
[00:00:04]               │ proc [kibana]         {
[00:00:04]               │ proc [kibana]           "range": {
[00:00:04]               │ proc [kibana]             "observer.version_major": {
[00:00:04]               │ proc [kibana]               "gte": 7
[00:00:04]               │ proc [kibana]             }
[00:00:04]               │ proc [kibana]           }
[00:00:04]               │ proc [kibana]         }
[00:00:04]               │ proc [kibana]       ]
[00:00:04]               │ proc [kibana]     }
[00:00:04]               │ proc [kibana]   },
[00:00:04]               │ proc [kibana]   "aggs": {
[00:00:04]               │ proc [kibana]     "error_groups": {
[00:00:04]               │ proc [kibana]       "terms": {
[00:00:04]               │ proc [kibana]         "field": "error.grouping_key",
[00:00:04]               │ proc [kibana]         "size": 500,
[00:00:04]               │ proc [kibana]         "order": {
[00:00:04]               │ proc [kibana]           "_count": "desc"
[00:00:04]               │ proc [kibana]         }
[00:00:04]               │ proc [kibana]       },
[00:00:04]               │ proc [kibana]       "aggs": {
[00:00:04]               │ proc [kibana]         "sample": {
[00:00:04]               │ proc [kibana]           "top_hits": {
[00:00:04]               │ proc [kibana]             "_source": [
[00:00:04]               │ proc [kibana]               "error.log.message",
[00:00:04]               │ proc [kibana]               "error.exception.message",
[00:00:04]               │ proc [kibana]               "error.exception.handled",
[00:00:04]               │ proc [kibana]               "error.exception.type",
[00:00:04]               │ proc [kibana]               "error.culprit",
[00:00:04]               │ proc [kibana]               "error.grouping_key",
[00:00:04]               │ proc [kibana]               "@timestamp"
[00:00:04]               │ proc [kibana]             ],
[00:00:04]               │ proc [kibana]             "sort": [
[00:00:04]               │ proc [kibana]               {
[00:00:04]               │ proc [kibana]                 "@timestamp": "desc"
[00:00:04]               │ proc [kibana]               }
[00:00:04]               │ proc [kibana]             ],
[00:00:04]               │ proc [kibana]             "size": 1
[00:00:04]               │ proc [kibana]           }
[00:00:04]               │ proc [kibana]         }
[00:00:04]               │ proc [kibana]       }
[00:00:04]               │ proc [kibana]     }
[00:00:04]               │ proc [kibana]   },
[00:00:04]               │ proc [kibana]   "size": 0
[00:00:04]               │ proc [kibana] }
[00:00:04]               │ proc [kibana] 
[00:00:04]               │ proc [kibana] 
[00:00:04]               │ info Responded: /api/apm/services/foo/errors?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&uiFilters=%7B%7D&_debug=true
[00:00:04]               │ info Requesting: /api/apm/services/foo/errors/bar?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&uiFilters=%7B%7D. Expecting: response
[00:00:04]               │ info Responded: /api/apm/services/foo/errors/bar?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&uiFilters=%7B%7D
[00:00:04]               │ info Requesting: /api/apm/services/foo/errors/distribution?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&groupId=bar&uiFilters=%7B%7D. Expecting: response
[00:00:04]               │ info Responded: /api/apm/services/foo/errors/distribution?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&groupId=bar&uiFilters=%7B%7D
[00:00:04]               │ info Requesting: /api/apm/services/foo/errors/distribution?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&uiFilters=%7B%7D. Expecting: response
[00:00:04]               │ info Responded: /api/apm/services/foo/errors/distribution?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&uiFilters=%7B%7D
[00:00:04]               │ info Requesting: /api/apm/services/foo/metrics/charts?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&agentName=cool-agent&uiFilters=%7B%7D. Expecting: response
[00:00:04]               │ info Responded: /api/apm/services/foo/metrics/charts?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&agentName=cool-agent&uiFilters=%7B%7D
[00:00:04]               │ info Requesting: /api/apm/services?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&uiFilters=%7B%7D. Expecting: response
[00:00:04]               │ proc [kibana]   log   [12:48:42.766] [error][http] { Error: [parsing_exception] Unknown key for a START_ARRAY in [index]., with { line=1 & col=10 }
[00:00:04]               │ proc [kibana]     at respond (/dev/shm/workspace/install/kibana-2/node_modules/elasticsearch/src/lib/transport.js:349:15)
[00:00:04]               │ proc [kibana]     at checkRespForFailure (/dev/shm/workspace/install/kibana-2/node_modules/elasticsearch/src/lib/transport.js:306:7)
[00:00:04]               │ proc [kibana]     at HttpConnector.<anonymous> (/dev/shm/workspace/install/kibana-2/node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
[00:00:04]               │ proc [kibana]     at IncomingMessage.wrapper (/dev/shm/workspace/install/kibana-2/node_modules/elasticsearch/node_modules/lodash/lodash.js:4929:19)
[00:00:04]               │ proc [kibana]     at IncomingMessage.emit (events.js:203:15)
[00:00:04]               │ proc [kibana]     at endReadableNT (_stream_readable.js:1145:12)
[00:00:04]               │ proc [kibana]     at process._tickCallback (internal/process/next_tick.js:63:19)
[00:00:04]               │ proc [kibana]   status: 400,
[00:00:04]               │ proc [kibana]   displayName: 'BadRequest',
[00:00:04]               │ proc [kibana]   message:
[00:00:04]               │ proc [kibana]    '[parsing_exception] Unknown key for a START_ARRAY in [index]., with { line=1 & col=10 }',
[00:00:04]               │ proc [kibana]   path: '/_search',
[00:00:04]               │ proc [kibana]   query: { ignore_throttled: true },
[00:00:04]               │ proc [kibana]   body:
[00:00:04]               │ proc [kibana]    { error:
[00:00:04]               │ proc [kibana]       { root_cause: [Array],
[00:00:04]               │ proc [kibana]         type: 'parsing_exception',
[00:00:04]               │ proc [kibana]         reason: 'Unknown key for a START_ARRAY in [index].',
[00:00:04]               │ proc [kibana]         line: 1,
[00:00:04]               │ proc [kibana]         col: 10 },
[00:00:04]               │ proc [kibana]      status: 400 },
[00:00:04]               │ proc [kibana]   statusCode: 400,
[00:00:04]               │ proc [kibana]   response:
[00:00:04]               │ proc [kibana]    '{"error":{"root_cause":[{"type":"parsing_exception","reason":"Unknown key for a START_ARRAY in [index].","line":1,"col":10}],"type":"parsing_exception","reason":"Unknown key for a START_ARRAY in [index].","line":1,"col":10},"status":400}',
[00:00:04]               │ proc [kibana]   toString: [Function],
[00:00:04]               │ proc [kibana]   toJSON: [Function] }
[00:00:04]               │ info Responded: /api/apm/services?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&uiFilters=%7B%7D
[00:00:04]               │ debg deleting role global_all
[00:00:04]               │ proc [kibana]  error  [12:48:42.695]  Error: Internal Server Error
[00:00:04]               │ proc [kibana]     at HapiResponseAdapter.toInternalError (/dev/shm/workspace/install/kibana-2/src/core/server/http/router/response_adapter.js:69:19)
[00:00:04]               │ proc [kibana]     at Router.handle (/dev/shm/workspace/install/kibana-2/src/core/server/http/router/router.js:163:34)
[00:00:04]               │ proc [kibana]     at process._tickCallback (internal/process/next_tick.js:68:7)
[00:00:04]               │ debg deleting user global_all
[00:00:04]               │ debg deleted user global_all
[00:00:04]               └- ✖ fail: "APM specs (basic) apm feature controls APIs can be accessed by global_all user"
[00:00:04]               │

Stack Trace

Error: Endpoint: GET /api/apm/services?start=2020-06-28T12%3A48%3A28.110Z&end=2020-06-28T12%3A48%3A38.110Z&uiFilters=%7B%7D
          Status code: 500
          Response: An internal server error occurred.

          expected 500 to equal 200
    at executeRequests (test/apm_api_integration/basic/tests/feature_controls.ts:249:15)

Kibana Pipeline / x-pack-intake-agent / X-Pack Jest Tests.x-pack/plugins/apm/server/lib/services.services queries fetches the service items

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has not failed recently on tracked branches


Stack Trace

Error: expect(received).toMatchSnapshot()

Snapshot name: `services queries fetches the service items 1`

- Snapshot  - 5
+ Received  + 5

@@ -29,10 +29,15 @@
            "field": "service.name",
            "size": 500,
          },
        },
      },
+     "index": Array [
+       "myIndex",
+       "myIndex",
+       "myIndex",
+     ],
      "query": Object {
        "bool": Object {
          "filter": Array [
            Object {
              "terms": Object {
@@ -60,11 +65,6 @@
          ],
        },
      },
      "size": 0,
    },
-   "index": Array [
-     "myIndex",
-     "myIndex",
-     "myIndex",
-   ],
  }
    at Object.it (/dev/shm/workspace/kibana/x-pack/plugins/apm/server/lib/services/queries.test.ts:43:25)

and 1 more failures, only showing the first 3.

Build metrics

✅ unchanged

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@dgieselaar
Copy link
Member

@sqren just my 2$, I like Setup. Are there specific parts that you are concerned about?

@sorenlouv
Copy link
Member Author

@sqren just my 2$, I like Setup. Are there specific parts that you are concerned about?

@dgieselaar It's just yet another thing that's opaque. For instance when setup is passed along with other parameters and especially when it's modified like myFunc({..setup, foo: 'bar' }).
Good to know you like it, and if no-one else minds we should keep it as-is.

@sorenlouv sorenlouv closed this Jul 15, 2020
@sorenlouv sorenlouv deleted the poc-simplify-projections-and-setup branch July 15, 2020 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants